home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
385
/
prg_1
/
prg_1dp.s
< prev
next >
Wrap
Text File
|
1985-11-19
|
2KB
|
54 lines
; Program Name: PRG_1DP.S
; Version: 1.002
; Assembly Instructions:
; Assemble in PC-relative mode and save with PRG and TOS extensions.
; Program Function:
; Prints a newline (combination of a carriage return and a linefeed)
; to the video screen before it prints a string. This added feature
; prevents the string from overwriting the AssemPro debugger screen, if
; the Save Screen debugger option is chosen before the assembled program
; is relocated with the Relocate option or before it is loaded with the
; Execute Program option.
; After the string has been written, the program waits until a key is
; pressed on the keyboard. When that event occurs, it returns control to
; AssemPro.
; Note - We have not defined a program stack. We are using the default
; system stack located at $4DB8, according to Internals p. 276.
print_newline: ; Prints a carriage return and linefeed.
pea newline ; Push address of string onto stack.
move.w #9, -(sp) ; Function = c_conws = GEMDOS $9.
trap #1
addq.l #6, sp
print_string:
pea string ; Push address of the string onto stack.
move.w #9, -(sp) ; Function = c_conws = GEMDOS $9.
trap #1
addq.l #6, sp
wait_for_keypress:
move.w #8, -(sp) ; Function = c_necin = GEMDOS $8.
trap #1
addq.l #2, sp
terminate:
move.w #0, -(sp) ; Function = p_term_old = GEMDOS $0.
trap #1
data
newline: dc.b $D,$A,0 ; All strings must be NULL terminated because the
; function we are used to print them requires it.
string: dc.b 'This string will not overwrite the AssemPro debugger screen.'
dc.b $D,$A,0 ; The string is continued on this line. Here, we
; declare a carriage return, linefeed and terminate
; the entire string with a NULL = 0.
end